package org.siva.sivaprasanna;

import java.io.IOException;
import java.io.PrintWriter;

import javax.jws.soap.InitParam;
import javax.management.Descriptor;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class XmlServlet extends HttpServlet {
	/**
	 * 
	 */
	
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html");
		PrintWriter out=response.getWriter();
		String username=request.getParameter("username");
		out.print("Hello from the get  " +username);
		
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html");
		PrintWriter out=response.getWriter();
		String username=request.getParameter("user name");
		String Fullname=request.getParameter("Full Name");
		out.println("username " +username+""+Fullname+"<br>");
		String prof=request.getParameter("prof");
		//String loc=request.getParameter("location");
	  String [] loc=request.getParameterValues("location");
		out.println("your prof  "+prof+"<br>");
		out.println("location is: "+loc.length+ " places");
		for(int i=0; i<loc.length; i++)
		{
			out.print(loc[i]);
		}
			}
}
